package com.cnunicom.modules.tra.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * @Author: dingziyuan
 * @Date: 2019/12/10 10:08
 * @Description: 模板控制器
 */
@Controller
@RequestMapping("/success")
public class ThymeleafController {

    @RequestMapping("/success")
    public String index(Map<String,Object> paramMap) {
        /* 默认Map的内容会放大请求域中，页面可以直接取值*/
        paramMap.put("name", "zhangsan");
        paramMap.put("age", 29);

        /* 会自动跳转到默认的 classpath:/templates/success.html 页面*/
        return "success";
    }
}
